package com.dongdongmovie.service.impl;

import com.dongdongmovie.mapper.TAreaMapper;
import com.dongdongmovie.pojo.TArea;
import com.dongdongmovie.service.TArea_Service;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DubboService
public class TArea_ServiceImpl implements TArea_Service {

    //注入mapper
    @Autowired
    private TAreaMapper tAreaMapper;

    //根据id查询数据
    @Override
    public TArea showbyId(Integer id) {
        return tAreaMapper.selectByPrimaryKey(id);
    }

    //查询数据
    @Override
    public List<TArea> show() {
        return tAreaMapper.selectByExample(null);
    }

    //添加数据
    @Override
    public int add(TArea tArea) {
        return tAreaMapper.insertSelective(tArea);
    }

    @Override
    public int update(TArea tArea) {
        return tAreaMapper.updateByPrimaryKeySelective(tArea);
    }

    //删除数据
    @Override
    public int delete(Integer id) {
        return tAreaMapper.deleteByPrimaryKey(id);
    }
}
